/**
 * 
 */
package ivan.cheng.tuqu;

import android.app.Application;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

/**
 * @author zhengfang
 * 
 *         For data exchange
 * 
 */
public class TuQulication extends Application {
	
	private String sScreenWidth = null;
	private String sScreenHeight = null;
	public void setSreccnWidth(String width) {
		sScreenWidth = width;
	}

	static {
		System.loadLibrary("tuqu_uu");
		System.loadLibrary("mtimage-jni");
		System.loadLibrary("tuqu_mt");
	}
	
	public String getScreenWidth() {

		if (null == sScreenWidth) {
			DisplayMetrics dm = new DisplayMetrics();
			WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
			wm.getDefaultDisplay().getMetrics(dm);
			sScreenWidth = String.valueOf(dm.widthPixels);
			sScreenHeight = String.valueOf(dm.heightPixels);
		}
		return sScreenWidth;
	}

	public void setSreccnHeight(String height) {
		sScreenHeight = height;
	}

	public String getScreenHeight() {
		if (null == sScreenHeight) {
			DisplayMetrics dm = new DisplayMetrics();
			WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
			wm.getDefaultDisplay().getMetrics(dm);
			sScreenWidth = String.valueOf(dm.widthPixels);
			sScreenHeight = String.valueOf(dm.heightPixels);
		}
		return sScreenHeight;
	}
}
